﻿namespace BlogsAPI.Rdf
{
    using System.Xml.Serialization;

    /// <summary>
    /// Some properties of RDF elements.
    /// Based on The RDF Vocabulary (RDF) at http://www.w3.org/1999/02/22-rdf-syntax-ns#
    /// and http://www.w3.org/TR/rdf-schema/
    /// </summary>
    public class RdfElement : DublinCore
    {
        /// <summary>
        /// Link on additional information
        /// </summary>
        [XmlAttribute("about", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string About { get; set; }

        /// <summary>
        /// Where to get object
        /// </summary>
        [XmlAttribute("resource", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string Resource { get; set; }

        /// <summary>
        /// The subject is an instance of a class.
        /// </summary>
        [XmlAttribute("type", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string RdfType { get; set; }

        /// <summary>
        /// The subject of the subject RDF statement.
        /// </summary>
        [XmlAttribute("subject", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string RdfSubject { get; set; }

        /// <summary>
        /// The predicate of the subject RDF statement.
        /// </summary>
        [XmlAttribute("predicate", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string Predicate { get; set; }

        /// <summary>
        /// The object of the subject RDF statement.
        /// </summary>
        [XmlAttribute("object", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string Object { get; set; }

        /// <summary>
        /// Idiomatic property used for structured values.
        /// </summary>
        [XmlAttribute("value", Namespace = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")]
        public string Value { get; set; }

        /// <summary>
        /// A description of the subject resource.
        /// </summary>
        /// <remarks>Another way to write dc:description</remarks>
        [XmlElement("comment", Namespace = "http://www.w3.org/2000/01/rdf-schema#")]
        public string Comment {
            get { return Description; }
            set { Description = value; }
        }

        /// <summary>
        /// A human-readable name for the subject.
        /// </summary>
        /// <remarks>Another way to write dc:title</remarks>
        [XmlElement("label", Namespace = "http://www.w3.org/2000/01/rdf-schema#")]
        public string Label
        {
            get { return Title; }
            set { Title = value; }
        }
    }
}
